﻿<?php
require_once 'includes/includes.php';
conexion();

if(!isset($_POST['submit'])){



	$nombre=sqlstring(cleanxss($_POST['nombre']));
	$email=sqlstring(cleanxss($_POST['email']));
	$comentario=sqlstring(cleanxss($_POST['comentario']));
	$celular=sqlstring(cleanxss($_POST['celular']));

// Primero comprobamos que ning�n campo est� vac�o y que todos los campos existan.
if(isset($nombre) && !empty($nombre) && isset($email) && !empty($email) && isset($comentario) && !empty($comentario)){
	mysql_query("INSERT INTO contacts (name,email,comment,celular) VALUES ('{$nombre}','{$email}','{$comentario}','{$celular}')");     
    $msj= 'Muchas gracias por contactarse.';
	
}
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title><?php titulo(); ?></title>

<?php require_once 'includes/head.php'; ?>

<link rel="stylesheet" href="plugins/vSlider/css/vslider.css" />
<link rel="stylesheet" href="plugins/slideViewer/css/slideviwer.css" />


<script type="text/javascript" src="plugins/jquery_validate/jquery.validate.js"></script>

<script type="text/javascript" src="plugins/vSlider/js/jquery.vslider.js" ></script>
<script src="plugins/slideViewer/sliderviewer.js" type="text/javascript"></script>
<script src="plugins/slideViewer/jquery-easing.js" type="text/javascript"></script>
<style type="text/css">
#firma{
	float:right;
	
}

.center{
text-align:center;
}


/*################ERROR VALIDACION###########################*/

.error{
    color: #D8000C;
    font-size:12px;
    border-color:#F00;
    margin-left: 5px;    
              
}

#areabus{
	margin: 0px auto 0px auto;
	text-align:center;
}
</style>


 <script type="text/javascript">
	$(function(){
	$("#slide").vSlider({time:6000, 
		effect:9, 
		maskInduration:30, 
		maskOutduration:10,
		width:470,
		height:350
			
		});
	});
</script>

<script type="text/javascript">
	$(window).bind("load", function() {
	$("div#mygalone").slideView({
		toolTip: true, 
		ttOpacity: 0.5,
		easeFunc: "easeInOutSine",
		easeTime: 2200


		
		})
});
</script>

<script>

  $(document).ready(function(){
		
	$("#formulario").validate({
		rules: {			
			nombre: {
				required: true			
			},
            email: {
                required: true,
				email: true
            },
			comentario:{
				required: true
			}
		},
		messages: {
			nombre:{
                required: ""
            },
			email: {
				required: "",
				email: ""
			},
			comentario:{
				required: ""
			}
			
		}
	});
	
  });
</script>

</head>

<body>
<div id="wrapper">

	<?php require_once 'includes/encabezado.php'; ?>
	<!-- end #header -->
	
	
	
		
		<div id="sidebarleft">				
			<?php require 'includes/sidebar.php'; ?>
		</div>
	
		<div id="content">
		
		
<?php
if(isset($msj)){
echo '<div class="exitoa mensajes">'.$msj.'</div>';
}
?>

<div class="titulo">Contactese con nosotros..</div>

<br />

<div id="areabus" style="width:370px"> 

<form id="formulario" name="formulario" action="#" method="post">



<fieldset style="width:350px" class="fieldsetfront">
<legend>Ingrese los datos de contacto</legend>
<br/>	
<p><span>Nombre:</span>
<input type="text" name="nombre" id="nombre" size="25" class="required"/>(*)
</p>
<p><span>E-mail:</span>
<input type="text" name="email" id="email" size="25" class="required email">(*)
</p>
<p><span>Comentario: </span>
<textarea name="comentario" id="comentario" cols="20" rows="5" class="required"></textarea>(*)
</p>

<p><span>Celular</span>
<input type="text" name="celular" id="celular" size="25" style="margin-right:16px" />  
</p><br/>

<div class="boton" align="center">
Los campos marcados con (*) son obligatorios.
</div>

<div class="boton" align="center"><br />
	<input class="buttonfront" type="submit" value="Aceptar">
</div>
</fieldset>	

</form>

</div>

		
		</div>
		<!-- end #content -->
		
		<div id="sidebarright">		
		<?php
                                require_once 'includes/publicidades.php';
         ?>
                
		</div>
		<!-- end #sidebar -->
		
		
	
	
	<!-- end #page -->
</div>
<div style="clear: both;">&nbsp;</div>
	<div id="footer">
		<?php require_once 'includes/pie.php'; ?>
	</div>
	<!-- end #footer -->
</body>
</html>
